package com.qingcheng.controller.order;

import com.qingcheng.service.order.CategoryReportService;
import com.qingcheng.service.order.OrderService;
import jdk.nashorn.internal.ir.annotations.Reference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

//@Component
public class OrderTask {

//    @Autowired
//    private OrderService orderService;
//    @Scheduled(cron = "* * * * * ?")
    public void orderTimeOutLogic(){
        System.out.println("每两分钟间隔执行一次任务"+ new Date());
//        orderService.orderTimeOutLogic();
    }


    @Reference
    private CategoryReportService categoryReportService;
    @Scheduled(cron = "0 0 1 * * ?")
    public void createCategoryReportData(){
        System.out.println("createCategoryReportData");
        categoryReportService.createData();
    }
}
